import java.util.*;

public class Member {
	
	private int uniformNumber;
	private boolean goalie;
	private HashMap<String,Double> data;
	private int type = 0;
	
	public Member(int number, boolean goalie, String data) {
		this.uniformNumber = number;
		this.goalie = goalie;
		this.data = new HashMap<String,Double>();
		String[] datum = data.split(" ");
		this.type = datum.length;
		switch (this.type) {
			case 6:
				this.data.put("Distance", Double.parseDouble(datum[0]));
				this.data.put("Direction", Double.parseDouble(datum[1]));
				this.data.put("DistChange", Double.parseDouble(datum[2]));
				this.data.put("DirChange", Double.parseDouble(datum[3]));
				this.data.put("BodyFacingDir", Double.parseDouble(datum[4]));
				this.data.put("HeadFacingDir", Double.parseDouble(datum[5]));
				break;
			case 4:
				this.data.put("Distance", Double.parseDouble(datum[0]));
				this.data.put("Direction", Double.parseDouble(datum[1]));
				this.data.put("DistChange", Double.parseDouble(datum[2]));
				this.data.put("DirChange", Double.parseDouble(datum[3]));
				break;
			case 2:
				this.data.put("Distance", Double.parseDouble(datum[0]));
				this.data.put("Direction", Double.parseDouble(datum[1]));
				break;
			case 1:
				this.data.put("Direction", Double.parseDouble(datum[0]));
				break;
		}
	}
	
	public int getNumber() {
		return this.uniformNumber;
	}
	
	public boolean isGoalie() {
		return this.goalie;
	}
	
	public int getType() {
		return this.type;
	}
	
	public double getValue(String value) {
		double returnValue = this.data.get(value);
		return returnValue;
	}

}
